import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/home/home.vue'
import Cla from '@/views/home/cla.vue'
import Cart from '@/views/home/cart.vue'
import My from '@/views/home/my.vue'
import Index from '@/views/home/index.vue'
import Search from '@/views/home/search.vue'
import Ksf from '@/views/home/ksf.vue'
import Kaf from '@/views/home/kaf.vue'
import Xq from '@/views/home/xq.vue'
import Zf from '@/views/home/zf.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', redirect: '/kaf' },
    {
      path: '/home',
      name: 'home',
      component: Home, children: [
        {
          path: 'cla',
          name: 'cla',
          component: Cla
        },
        {
          path: 'cart',
          name: 'cart',
          component: Cart
        },
        {
          path: 'my',
          name: 'my',
          component: My
        }, {
          path: 'index',
          name: 'index',
          component: Index
        },
      ]
    },
    {
      path: '/search',
      name: 'search',
      component: Search
    },
    {
      path: '/kaf',
      name: 'kaf',
      component: Kaf
    },
    {
      path: '/ksf',
      name: 'ksf',
      component: Ksf
    },
    {
      path: '/xq/:goods_id',
      name: 'xq',
      component: Xq
    },
        {
      path: '/zf',
      name: 'zf',
      component: Zf
    },
  ],
})

export default router
